< previous page page_485 next page >

Page 485
e10a6a0a59f035e870d90cca05b85fce.gif
            '    +      \_ 
            '     \      \ 
            '      +-------+ 
            ' draw the top first so the right side
            ' doesn't make hi() too bit and stop
            ' the top from being drawn.
            ' 
            ' This only happens with perspective
            ' projection.
            If Points(i + 1, j).trans(1) >= _ 
                Points(i, j).trans(1) _ 
            Then
                DrawLine pic, _ 
                    Points(i, j).trans(1), _
                    Points(i, j).trans(2), _
                    Points(i, j + 1).trans(1), _ 
                    Points(i, j + 1).trans(2), _ 
                    hi, lo 
                DrawLine pic, _ 
                    Points(i, j).trans(1), _ 
                    Points(i, j).trans(2), _ 
                    Points(i + 1, j).trans(1), _
                    Points(i + 1, j).trans(2), _
                    hi, lo
            Else
                DrawLine pic, _
                    Points(i, j).trans(l), _
                    Points(i, j).trans(2), _
                    Points(i + 1, j).trans(1), _ 
                    Points(i + 1, j).trans(2), _ 
                    hi, lo
                DrawLine pic, _
                    Points(i, j).trans(1), _
                    Points(i, j).trans(2), _
                    Points(i, j + 1).trans(1), _
                    Points(i, j + 1).trans(2), _
                    hi, lo
            End If
        Next j
    Next i
End Sub

' Draw a line between the points. Set the hi and
' lo values for the line.
Private Sub DrawAndSetLine(ByVal pic As PictureBox, _
    ByVal x1 As Single, ByVal y1 As Single, _
    ByVal x2 As Single, ByVal y2 As Single, _
    hi() As Integer, lo() As Integer)
Dim tmp As Single
Dim ix As Integer
Dim iy As Integer

 
< previous page page_485 next page >